1. Field of the Invention
The present invention relates to a transcoder for converting an input stream by decoding into a different output stream, and more particularly to a technique to appropriately control the amount of generated codes of the output stream toward a target bit rate.
2. Description of the Background Art
Images to be delivered on digital broadcasts, those to be stored in media such as DVDs and hard disks, and the like are compressed in accordance with various coding systems. The object for such compressions is to avoid constraint on a transmission band, increase the transmission speed, decrease the memory size, or the like.
There are various standards for image coding system, such as MPEG2 and H.264. And there is a case where the coding system is converted for the purpose of reducing the amount of codes in a coded image that is inputted, or the like. A transcoder once decodes the inputted coded image. Then, the transcoder codes the decoded image in a different coding system (or the same coding system) again. Thus, the transcoder controls a bit rate of an output stream.
Japanese Patent Application Laid Open Gazette No. 2006-74635 relates to a transcoder for converting an image compressed in a first compressive coding system into an image compressed in a second compressive coding system. This transcoder uses intermediate information generated during the decoding of the image compressed in the first compressive coding system to compress the image in the second compressive coding system.
The stream inputted into the transcoder includes various scenes. Included are scenes which cause degradation of image quality if a larger amount of codes are not allocated thereto, scenes which do not cause degradation of image quality even if a larger amount of codes are not allocated thereto, and the like. Therefore, the degree of difficulty in image compression significantly varies depending on the scene.
On the other hand, the purpose of code amount control is to keep the bit rate in a certain period constant, regardless of the degree of difficulty in image compression as discussed above. How long the period is, for which the bit rate is kept constant, depends on the band limiting of a channel, the requirements specification of a user for image quality, or the like.
Assuming that the band limiting of a channel is strict, for example, the response time of feedback in the code amount control needs to be set shorter. In other words, the period for which the bit rate is kept constant needs to be set shorter. Such a code amount control disadvantageously causes degradation of image quality.
Conversely, if priority is given to the image quality, the response time of feedback in the code amount control needs to be set longer. In other words, the period for which the bit rate is kept constant is set longer, and for the period, some degree of freedom is given to the bit rate, to increase the image quality. Since there is a possibility, however, that such a control locally increases or decreases the bit rate, there arise some cases where it is not compatible with the band limiting of the channel.